<template>
  <div>
    <div class="search-group" v-if="this.path == 'exWarehouse-page1'">
      <div class="search-gropu-item">
        <label>出库单号</label>
        <el-input v-model="listQuery.chukudh" placeholder="请输入"></el-input>
      </div>
      <div class="search-gropu-item">
        <label>名称</label>
        <el-input v-model="listQuery.mingcheng" placeholder="请输入"></el-input>
      </div>
      <div class="search-gropu-item">
        <label>出库类型</label>
        <el-select v-model="listQuery.chukulx" placeholder="请选择">
          <el-option
            v-for="(item, index) in $util.getCklx()"
            :key="index"
            :label="item.name"
            :value="item.id"
          ></el-option>
        </el-select>
      </div>
      <div class="search-gropu-item">
        <label>出库单状态</label>
        <el-select v-model="listQuery.danjuzt" placeholder="请选择">
          <el-option
            v-for="(item, index) in $util.getCkzt()"
            :key="index"
            :label="item.name"
            :value="item.id"
          ></el-option>
        </el-select>
      </div>
      <!-- <div class="search-gropu-item">
        <label>创建时间</label>
        <el-date-picker
          v-model="listQuery.startTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="选择日期"
        ></el-date-picker>
      </div> -->
      <div class="search-button">
        <el-button type="primary" icon="el-icon-search" @click="searchCkd">
          查询
        </el-button>
        <el-button icon="el-icon-refresh" @click="resetlist">重置</el-button>
      </div>
    </div>
    <div class="search-group" v-if="this.path == 'exWarehouse-page2'">
      <div class="search-gropu-item">
        <label>任务单号</label>
        <el-input v-model="listQuery.renwudh" placeholder="请输入"></el-input>
      </div>
      <div class="search-gropu-item">
        <label>出库单号</label>
        <el-input v-model="listQuery.chukudh" placeholder="请输入"></el-input>
      </div>
      <div class="search-gropu-item">
        <label>起始点</label>
        <el-input v-model="listQuery.qishid" placeholder="请输入"></el-input>
      </div>
      <!-- <div class="search-gropu-item">
        <label>终结点</label>
        <el-input v-model="listQuery.zhongjied" placeholder="请输入"></el-input>
      </div> -->
      <div class="search-gropu-item">
        <label>状态</label>
        <el-select v-model="listQuery.zhuangtai" placeholder="请选择">
          <el-option
            v-for="(item, index) in $util.getJhdzt()"
            :key="index"
            :label="item.name"
            :value="item.id"
          ></el-option>
        </el-select>
      </div>

      <div class="search-gropu-item">
        <label>挂件码</label>
        <el-input v-model="listQuery.guajiam" placeholder="请输入"></el-input>
      </div>
      <div class="search-gropu-item">
        <label>货位号</label>
        <el-input v-model="listQuery.huoweih" placeholder="请输入"></el-input>
      </div>
      <div class="search-gropu-item">
        <label>托盘号</label>
        <el-input v-model="listQuery.tuopanh" placeholder="请输入"></el-input>
      </div>

      <div class="search-button">
        <el-button type="primary" icon="el-icon-search" @click="searchJhd">
          查询
        </el-button>
        <el-button icon="el-icon-refresh" @click="resetlist">重置</el-button>
      </div>
    </div>
  </div>
</template>
<script>
  export default {
    name: 'Test',
    data() {
      return { show: true, cklxlist: [], wzqflist: [], zhuanyelist: [] }
    },
    props: {
      listQuery: {
        type: Object,
        default: {},
        required: true,
      },
      path: {
        type: String,
        default: null,
        require: true,
      },
    },
    created() {},
    async mounted() {
      this.cklxlist = await this.$util.getCKlxlist()
      this.wzqflist = await this.$util.getWzqflist()
      this.zhuanyelist = await this.$util.getWzzy()
    },
    methods: {
      searchCkd() {
        this.$parent.searchCkd()
      },
      searchJhd() {
        this.$parent.searchJhd()
      },
      resetlist() {
        this.$parent.resetlist()
      },
    },
  }
</script>
<style lang="scss" scoped>
  .search-group {
    display: flex;
    flex-flow: row wrap;

    .search-gropu-item {
      padding: 10px 20px;
      width: calc((100% - 20px * 8) / 4);
      display: flex;

      label {
        width: 0.8rem;
        white-space: nowrap;
        line-height: 0.32rem;
        margin-right: 0.1rem;
      }

      .el-select {
        width: 100%;
      }
    }

    .search-gropu-item-time {
      width: 500px !important;
      padding: 10px 20px;
      display: flex;

      label {
        white-space: nowrap;
        line-height: 32px;
        margin-right: 10px;
      }
    }

    .search-button {
      margin-left: auto;
      padding: 0.1rem 0.2rem;

      .el-button {
        font-size: 0.14rem !important;
      }
    }
  }

  ::v-deep {
    .el-date-editor {
      width: 100% !important;
    }
  }
</style>
